
<script>
export default {
  name: "CustomCell",
  functional: true,
  props: {
    row: Object,
    column: Object,
    render: Function,
    index: Number,
    tableData: Array
  },
  render: (h, ctx) => {
    if (typeof ctx.props.render === "function") {
      const params = {
        row: ctx.props.row,
        column: ctx.props.column,
        index: ctx.props.index,
        tableData: ctx.props.tableData,
        _self: ctx
      };
      return ctx.props.render.call(ctx.parent.$parent, h, params);
    } else {
      if (typeof ctx.props.column.formatter === "function") {
        return h("span",ctx.props.column.formatter.call(ctx.parent.$parent,ctx.props.row));
      }
      return h("span",{class:{}}, ctx.props.row[ctx.props.column.prop]||(ctx.props.column.valueType==='number'?'0':' '));
    }
  }
};
</script>

<style lang="scss">
.el-table td.el-table__cell div {
  white-space: pre-wrap;
}
</style>



